package cn.itcast.demo.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author 虎哥
 */
@Slf4j
//@Component
public class HelloJob {

    boolean boo = true;
    @Scheduled(fixedRate = 1000)
    public void hello() throws InterruptedException {
        log.warn("定时任务正在执行。。");
        if(boo) {
            Thread.sleep(3000);
            boo = false;
        }
    }
}
